package generate_address_config

import (
	"chain_bridge_service/configs"
	"context"
	"go.mongodb.org/mongo-driver/mongo"
)

func NewModel() *GenerateAddressConfig {
	return new(GenerateAddressConfig)
}

func (g *GenerateAddressConfig) Create(db *mongo.Client) error {
	cfg := configs.Get().Mongodb
	client := db.Database(cfg.Config.Name).Collection("generate_address_config")
	_, err := client.InsertOne(context.TODO(), g)
	return err
}
